﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CVSA.Suporte.Sinacor.BMFBovespa.Negocio;

namespace CVSA.Suporte.Sinacor.BMFBovespa.ConsultaRemedy
{
    public partial class sitestats : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                cal.SelectedDate = DateTime.Today;
                gvSiteStats.DataSource = new Negocio.Users().getSiteStats(Convert.ToDateTime(cal.SelectedDate), Convert.ToDateTime(cal.SelectedDate));
                gvSiteStats.DataBind();
            }
        }

        protected void cal_SelectionChanged(object sender, EventArgs e)
        {
            gvSiteStats.DataSource = new Negocio.Users().getSiteStats(Convert.ToDateTime(cal.SelectedDates[0]), Convert.ToDateTime(cal.SelectedDates[cal.SelectedDates.Count - 1 ]));
            gvSiteStats.DataBind();
        }
    }
}
